import IHalf from "./interface";
import * as service from "@/service/index";
const half: IHalf = {
  namespaced: true,
  state: {
    halfNav: [],
  },
  actions: {
    async getHalfList({ commit }) {
      const result = await service.fetchHalfList();
      const action = {
        type: "GET_HALF_LIST",
        payload: result?.data,
      };
      commit(action);
    },
  },
  mutations: {
    GET_HALF_LIST(state, action) {
      state.halfNav = action.payload;
    },
  },
};

export default half;
